package top.jiachunlei.command;

import java.util.ArrayList;
import java.util.List;

/**
 * 命令调用类
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/12/10 22:17
 */
public class Broker
{
    private List<Order> orderList = new ArrayList<Order>();

    public void takeOrder(Order order) {
        orderList.add(order);
    }

    public void placeOrders(){
        for (Order order : orderList)
        {
            order.execute();
        }
        orderList.clear();
    }
}
